/* 
 * File:   Die.cpp
 * Author: nstratos
 * 
 * Created on September 20, 2012, 9:36 AM
 */

#include "Die.hpp"
#include <iostream>
#include <cstdlib>
#include <time.h>
using namespace std;

Die::Die(int sides) {
    this->sides = sides;
    std::srand(time(0));
}

Die::Die(const Die& orig) {
    this->sides = orig.sides;
}

Die::~Die() {
}

int Die::roll() {
    //time_t seconds;
    //time(&seconds);
    //std::srand(time());
    //std::srand((unsigned int) seconds);
    int roll = (std::rand() % this->sides) + 1;
    //cout << "@@DIE ROLLED " << roll << endl;
    return roll;
}
